<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8" />
	<title>登录</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body class="login_bg">
	<!--nav-->
	<div class="container met-head">
		<div class="row">
			<div class="col-xs-6 col-sm-6 logo">
				<ul class="list-none">
					<li>
						<a href="javascript:;" class="met-logo">
							<img src="img/pic01.jpg" width="24" height="24"/ >
						</a>
					</li>
					<li>会员登录</li>
				</ul>
			</div>
			<div class="col-xs-6 col-sm-6 user-info">
				<ol class="breadcrumb pull-right fanh_btn">
				  <li><a href="index.html" title="返回首页">返回首页</a></li>
				</ol>
			</div>
		</div>
	</div>								
	
	<!--content-->
	<div class="login_index met-member">
		<div class="container">
			<form method="post" action="">
				<input type="hidden" name="gourl" value="" />
				<div class="form-group">
					<input type="text" name="username" required class="form-control" placeholder="用户名"
					data-bv-notempty="true"
					data-bv-notempty-message="此项不能为空">
				</div>
				<div class="form-group">
					<input type="password" name="password" required class="form-control " placeholder="密码" 
					data-bv-notempty="true"
					data-bv-notempty-message="此项不能为空">
				</div>
				<div class="code_msg">
					<div class="form-group code_div fl">
						<input type="text" id="input" name="code" required class="form-control" placeholder="验证码" 
						data-bv-notempty="true"
						data-bv-notempty-message="此项不能为空">
					</div>
					<input type = "button" id="code"  class="codes fr"/> 
				</div>
				
				<div class="password_rem">
					<div class="remember fl">
					  <div class="checkbox">
					    <label>
					      <input type="checkbox" id="checkboxError" value="option1">
					      记住密码
					    </label>
					  </div>
				 	</div>
				</div>
				<button class="btn btn-lg btn-primary btn-block" type="submit" id="check">登录</button>
			</form>
		</div>
	</div>

	<!--foot-->
	<footer class="container met-footer">
		<p>某某公司 版权所有 © 2007-2017 <a href="" target="_blank">粤ICP备xxxxx号-3</a> </p>
		<p>地址：合肥市时代数码港</p>
		<p>服务热线：020-123456789</p>
	</footer>
	
</body>
<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
			function change(){
		    code=$("#code");
		  // 验证码组成库
		   var arrays=new Array( 
		       '1','2','3','4','5','6','7','8','9','0',
		       'a','b','c','d','e','f','g','h','i','j', 
		       'k','l','m','n','o','p','q','r','s','t', 
		       'u','v','w','x','y','z', 
		       'A','B','C','D','E','F','G','H','I','J', 
		       'K','L','M','N','O','P','Q','R','S','T', 
		       'U','V','W','X','Y','Z'        
		       ); 
		    codes='';// 重新初始化验证码
		   for(var i = 0; i<6; i++){
		   // 随机获取一个数组的下标
		   var r = parseInt(Math.random()*arrays.length);
		   codes += arrays[r];
		  }
		  // 验证码添加到input里
		     code.val(codes);
		  }
		  change();
		 code.click(change);
		  $("#check").click(function(){
		   var inputCode = $("#input").val().toUpperCase();  
//		  if(inputCode.length == 0) {
//		   alert("请输入验证码！"); 
//		  }    
		  if(inputCode!=codes.toUpperCase()) {
//			   alert("验证码输入错误!请重新输入"); 
			   change();//刷新验证码
			   $("#input").val("");//清空文本框
		  }
		  });
		  
		  
//		  $.ajax({
//			    url:',
//			    type:'POST', 
//			    async:true,    
//			    data:{},
//			    timeout:5000,    
//			    dataType:'json',
//			    success:function(data){
//			        console.log(data)
//			    },
//			    error:function(){
//			        console.log('错误')
//			    },
//			})
</script>
</html>